#include "FilterBits.h"
#include <stdio.h>
#include <assert.h>

void main(int argc,const char **argv)
{
	FilterBits *fb = createFilterBits();

	const FilterData *r1 = fb->getFilterData("a,b,c,d=e,f,a,c");

	const FilterData *r2 = fb->getFilterData("f,a,b=none");

	const FilterData *r3 = fb->getFilterData("d,c,b,a=c,a,f,e");

	const FilterData *r4 = fb->getFilterData("q,r,v,w=all");

	const FilterData *r5 = fb->getFilterData("a,b=e(0.5),f(0.2),c(3),default");

	assert( r1 == r3 );

	{
		printf("Defined %d types.\r\n", (int) fb->getTypeCount() );
		for (uint8_t i=0; i<fb->getTypeCount(); i++)
		{
			const char *type = fb->getTypeString(i);
			printf("Type%d = %s\r\n", (int)i+1, type );
		}
	}

	{
		const char *c = fb->getFilterDataString(*r1);
		printf("R1 : %s\r\n", c );
	}

	{
		const char *c = fb->getFilterDataString(*r2);
		printf("R2 : %s\r\n", c );
	}

	{
		const char *c = fb->getFilterDataString(*r3);
		printf("R3 : %s\r\n", c );
	}

	{
		const char *c = fb->getFilterDataString(*r4);
		printf("R4 : %s\r\n", c );
	}

	{
		const char *c = fb->getFilterDataString(*r5);
		printf("R5 : %s\r\n", c );
	}


	fb->release();
}
